package com.alexander.imgbannerwheelview;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

/**
 * @author 14014
 */
public class LifeListenerFragment extends Fragment
{
    private static final String TAG = "LifeListenerFragment";
    private LifeListener lifeListener;

    public void setLifeListener(LifeListener lifeListener)
    {
        this.lifeListener = lifeListener;
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        if(lifeListener != null)
        {
            lifeListener.onCreate();
        }
    }

    @Override
    public void onStart()
    {
        super.onStart();
        if(lifeListener != null)
        {
            lifeListener.onStart();
        }
    }

    @Override
    public void onResume()
    {
        super.onResume();
        if(lifeListener != null)
        {
            lifeListener.onResume();
        }
    }

    @Override
    public void onPause()
    {
        super.onPause();
        if(lifeListener != null)
        {
            lifeListener.onPause();
        }
    }

    @Override
    public void onStop()
    {
        super.onStop();
        if(lifeListener != null)
        {
            lifeListener.onStop();
        }
    }

    @Override
    public void onDestroy()
    {
        super.onDestroy();
        if(lifeListener != null)
        {
            lifeListener.onDestroy();
        }
    }
}
